package com.dolphin.artifact.dao;

import com.dolphin.artifact.dao.entity.UserInfo;
import com.dolphin.artifact.dao.entity.UserInfoCriteria;
import java.util.List;

import com.dolphin.artifact.dao.provider.UserInfoSqlProvider;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface UserInfoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @SelectProvider(type=UserInfoSqlProvider.class, method="countByExample")
    long countByExample(UserInfoCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @DeleteProvider(type=UserInfoSqlProvider.class, method="deleteByExample")
    int deleteByExample(UserInfoCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @Delete({
        "delete from user_info",
        "where n_id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @Insert({
        "insert into user_info (n_id, s_user_name, ",
        "s_password, d_create_time, ",
        "d_update_time)",
        "values (#{id,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, ",
        "#{password,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP})"
    })
    int insert(UserInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @InsertProvider(type=UserInfoSqlProvider.class, method="insertSelective")
    int insertSelective(UserInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @SelectProvider(type=UserInfoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="n_id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="s_user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="s_password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="d_create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="d_update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<UserInfo> selectByExample(UserInfoCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "n_id, s_user_name, s_password, d_create_time, d_update_time",
        "from user_info",
        "where n_id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="n_id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="s_user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="s_password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="d_create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="d_update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    UserInfo selectByPrimaryKey(Long id);


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @Select({
            "select",
            "n_id, s_user_name, s_password, d_create_time, d_update_time",
            "from user_info",
            "where s_user_name = #{userName,jdbcType=VARCHAR} and s_password = #{password,jdbcType=VARCHAR}"
    })
    @Results({
            @Result(column="n_id", property="id", jdbcType=JdbcType.BIGINT, id=true),
            @Result(column="s_user_name", property="userName", jdbcType=JdbcType.VARCHAR),
            @Result(column="s_password", property="password", jdbcType=JdbcType.VARCHAR),
            @Result(column="d_create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
            @Result(column="d_update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    UserInfo selectByUserName(@Param("userName")String userName ,@Param("password")String password);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @UpdateProvider(type=UserInfoSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") UserInfo record, @Param("example") UserInfoCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @UpdateProvider(type=UserInfoSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") UserInfo record, @Param("example") UserInfoCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @UpdateProvider(type=UserInfoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(UserInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_info
     *
     * @mbg.generated
     */
    @Update({
        "update user_info",
        "set s_user_name = #{userName,jdbcType=VARCHAR},",
          "s_password = #{password,jdbcType=VARCHAR},",
          "d_create_time = #{createTime,jdbcType=TIMESTAMP},",
          "d_update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where n_id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(UserInfo record);
}